﻿using System.ComponentModel;

namespace Toybox.NicoSharp.Live
{
  using Message;

  partial class LiveMessageClient
  {
    public class PostUser : INotifyPropertyChanged
    {

      #region [INotifyPropertyChanged]

      public event PropertyChangedEventHandler PropertyChanged;

      protected void OnPropertyChanged(string property)
      {
        if (PropertyChanged != null)
          PropertyChanged(this, new PropertyChangedEventArgs(property));
      }

      #endregion [INotifyPropertyChanged]


      #region Constructor

      public PostUser(PlayerStatus ps)
      {
        this.UserID = ps.user.user_id;
        this.PremiumType = ps.user.is_premium;
        this.UserDomain = ps.user.userDomain;
      }

      #endregion Constructor


      #region Public Members

      /// <summary>
      /// ユーザID
      /// </summary>
      public string UserID
      {
        get { return _userID; }
        protected set
        {
          if (_userID == value) return;

          _userID = value;

          OnPropertyChanged("UserID");
        }
      }
      private string _userID;

      /// <summary>
      /// プレミアムの種類
      /// </summary>
      public PremiumType PremiumType
      {
        get { return _premiumType; }
        protected set
        {
          if (_premiumType == value) return;

          _premiumType = value;

          OnPropertyChanged("PremiumType");
        }
      }
      private PremiumType _premiumType;

      /// <summary>
      /// ユーザーのドメイン
      /// </summary>
      public string UserDomain
      {
        get { return _userDomain; }
        protected set
        {
          if (_userDomain == value) return;

          _userDomain = value;

          OnPropertyChanged("UserDomain");
        }
      }
      private string _userDomain;

      #endregion Public Members

    }
  }
}